<?php

	class UrlRoutingToModelCommand implements ICommand
	{
		function execute($event)
		{
			$data = $event->data;
			$module = $data["module"];
			$name = $data["file"];
			$method = $data["method"];
			$output = isset($data["output"]) ? $data["output"] : "json";
				
			$model = EbModel::getModel($module,$name);

			$result = $model->$method();
			
			$response = EbController::$response;
			
			$response->content = $result;
			$response->type = $output;
			
			return $result;
		}
	}